import Vue from 'vue'
import Router from 'vue-router'
import login from '../views/login/login'
import adminRouter from './manage'

const manage = () => import(/* webpackChunkName: "manage" */ '@/views/manage/index');

Vue.use(Router);


export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  },
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/manage',
      name: 'manage',
      component: manage,
      children: adminRouter
    },
    { path: '/', redirect: 'manage/home' },
    { path: '*', redirect: 'manage/home' }
  ]
})
